package org.liulinlin.sejw.db;

import java.sql.*;

public class BoxAllocDetails { //extends DataAccessServiceImpl {
	private int id;
	private int orderedBigNum;
	private int passedBigNum;
	private int orderedSmallNum;
	private int passedSmallNum;
	
	public BoxAllocDetails() {
		
	}
	public BoxAllocDetails(int id) {
		DBConnectionManager connMgr = DBConnectionManager.getInstance();
		Connection con = connMgr.getConnection("shipping_export");
		if (con == null) {
			System.out.println("不能获得数据库连接");
			return;
		}
		
		try {
			Statement stmt = con.createStatement();
			ResultSet rs = stmt.executeQuery("select * from BoxAllocDetails where BAD_ID = '" + id + "'");
		
			rs.next();
			this.id = id;
			orderedBigNum = rs.getInt("BAD_OrderedBigNum");
			passedBigNum = rs.getInt("BAD_PassedBigNum");
			orderedSmallNum = rs.getInt("BAD_OrderedSmallNum");
			passedSmallNum = rs.getInt("BAD_PassedSmallNum");
			
			rs.close();
			stmt.close();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		connMgr.freeConnection("shipping_export", con);
		connMgr.release();
	}
	
	public void setId(int id) {
		this.id = id;
	}
	public void setOrderedBigNum(int orderedBigNum) {
		this.orderedBigNum = orderedBigNum;
	}
	public void setPassedBigNum(int passedBigNum) {
		this.passedBigNum = passedBigNum;
	}
	public void setOrderedSmallNum(int orderedSmallNum) {
		this.orderedSmallNum = orderedSmallNum;
	}
	public void setPassedSmallNum(int passedSmallNum) {
		this.passedSmallNum = passedSmallNum;
	}
	
	public int getId() {
		return id;
	}
	public int getOrderedBigNum() {
		return orderedBigNum;
	}
	public int getPassedBigNum() {
		return passedBigNum;
	}
	public int getOrderedSmallNum() {
		return orderedSmallNum;
	}
	public int getPassedSmallNum() {
		return passedSmallNum;
	}
}
